package com.fumin.service.impl;

import com.fumin.mapper.UserMapper;
import com.fumin.pojo.User;
import com.fumin.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by Lingo on 2018/2/11.
 */
@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserMapper userMapper;

    @Override
    public int deleteByPrimaryKey(Long pk) {
        return userMapper.deleteByPrimaryKey(pk);
    }

    @Override
    public int insert(User record) {
        return userMapper.insert(record);
    }

    @Override
    public int insertSelective(User record) {
        return userMapper.insertSelective(record);
    }

    @Override
    public User selectByPrimaryKey(Long pk) {
        return userMapper.selectByPrimaryKey(pk);
    }

    @Override
    public int updateByPrimaryKeySelective(User record) {
        return userMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(User record) {
        return userMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<User> selectFatherUsers(long pk) {
        return userMapper.selectFatherUsers(pk);
    }

    @Override
    public User selectByPhone(String phone) {
        return userMapper.selectByPhone(phone);
    }

    @Override
    public Map<String, Long> selectNum() {
        return userMapper.selectNum();
    }

    @Override
    public List<Map<String, Long>> selectRankData() {
        return userMapper.selectRankData();
    }

    @Override
    public List<Map<String, Object>> selectTop() {
        return userMapper.selectTop();
    }

    @Override
    public Map<String, Object> selectLast() {
        return userMapper.selectLast();
    }

    @Override
    public User selectByPcode(String pCode) {
        return userMapper.selectByPcode(pCode);
    }

    @Override
    public Map<String, String> selectAllFatherUsers(Long userId) {
        return userMapper.selectAllFatherUsers(userId);
    }

    @Override
    public List<User> selectAllFatherUsersInfo(List<String> userIds) {
        return userMapper.selectAllFatherUsersInfo(userIds);
    }
}
